package collapsedTypeHierarchyWrongIf;

public class Employee extends Human{

	private int _type;
	private int _monthlySalary;
	private int _commission;
	private int _bonus;
	public static final int ENGINEER = 0;
	public static final int SALESMAN = 1;
	public static final int MANAGER = 2;

	public Employee (int type, int comission, int bonus) {
		super("NONE");
		_type = type;
		_commission = comission;
		_bonus = bonus;
	}

	public Employee (int type) {
		this(type, 0, 0);
	}

	public Employee (int comission, int bonus) {
		super("NONE");
		_type = ENGINEER;
		_commission = comission;
		_bonus = bonus;
	}


	public int payAmount() {
		if (_type == Employee.ENGINEER)
			return _monthlySalary;
		else if (_type == Employee.SALESMAN)
			return _monthlySalary + _commission;
		else if (_type == Employee.MANAGER)
			return _monthlySalary + _bonus;
		else
			throw new RuntimeException("Incorrect Employee");
	}

}
